package com.jlastu.androidsx.model;

import android.app.Application;

import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.MutableLiveData;

import com.jlastu.androidsx.bean.Communication;

import java.util.ArrayList;
import java.util.List;

public class CommunicationModel extends AndroidViewModel {
    private MutableLiveData<List<Communication>> communicationliveData;

    public CommunicationModel(@NonNull Application application) {
        super(application);
        communicationliveData = new MutableLiveData<>();
    }

    public MutableLiveData<List<Communication>> getCommunicationList() {
        List<Communication> communications = new ArrayList<>();
        if (communications ==null || communications.size() == 0){
            communications.add(new Communication("农技学堂广育乡村“茶秀才”","","https://www.163.com/dy/article/I9CJJJOL05149VHU.html","2024-03-31 14:52"));
            communications.add(new Communication("兴农学堂│果蔬用肥有讲究 农技课堂助丰收","","https://mp.weixin.qq.com/s?__biz=MzA4MDQ1NDE3NQ==&mid=2650580139&idx=1&sn=6c918e39ef2a7a9871e1d45a0ef6c934&chksm=87abf3dbb0dc7acd53050a770be4fbe6c8a7f12da26634eb8de4abaaf6262d2197c062cebd10&scene=27","2023-07-31 14:52"));
            communications.add(new Communication("惠农网农技学堂送来科学妙方 知识扶贫促进农业产业发展","","https://baijiahao.baidu.com/s?id=1672902071431795830&wfr=spider&for=pc","2023-08-31 14:52"));
            communications.add(new Communication("羊角葱种植方法","","https://www.cnhnb.com/xt/article-124663.html","2023-07-05 00:03"));
            communications.add(new Communication("龙文进：珍视和传递夏粮丰收的成果","https://5b0988e595225.cdn.sohucs.com/images/20190612/057ce5dc75ca42d18adf5cf8496dfd87.jpeg","https://mp.weixin.qq.com/s?__biz=MzI1NTkxODcwNg==&mid=2247534739&idx=2&sn=4959c803240fd5ae3fa944526902f262&chksm=ea2c9f8edd5b16985735ff95abf810918988341ac9c4532ea1a9c914d3bd60daf52163b90e21&scene=27","2022-07-21 06:00"));
            communications.add(new Communication("晚稻优质高产栽培技术","","https://mp.weixin.qq.com/s?__biz=MzAwMjExMzEzMg==&mid=2650803203&idx=1&sn=7ff46b90b89ea36b26c1b64a299ed0d5&chksm=813bc700b64c4e16430397039978e25d4bcec81ae75194e649b236d77e7511078b1ab6282be0&scene=27","2023-07-31 14:52"));
            communications.add(new Communication("大白菜栽培技术","","https://m.qnong.com.cn/zhongzhi/shucai/2229.html","2014-03-04 13:33:49"));

            communicationliveData.postValue(communications);
        }
        return communicationliveData;
    }
}
